package com.yoga.db;

import com.yoga.entity.UserInfo;

public class UserInfoDao extends BaseDao {
	public int addUserWithIdReturn(UserInfo user) {
		if (dbHelper.getSession().insert("com.yoga.userInfoMapper.insert", user) > 0) {
			dbHelper.getSession().commit();
			return user.getUserId();
		}
		return -1;
	}

	public UserInfo get(int userId) {
		return dbHelper.getSession().selectOne("com.yoga.userInfoMapper.get", userId);
	}
}
